package server;

import common.Contact;

import java.io.IOException;
import java.util.List;

public class ContactManager {
    private final Model model;

    public ContactManager() {
        this.model = new Model();
    }

    public List<Contact> getContacts() throws IOException {
        return model.getContacts();
    }

    public void addContact(String name, String phone) throws IOException {
        model.addContact(new Contact(name, phone));
    }

    public void deleteContact(String name) throws IOException {
        model.deleteContact(name);
    }

    public void updateContact(String name, String newPhone) throws IOException {
        model.updateContact(name, newPhone);
    }
}
